<h1>Election:  <%= @election.name %>/<%= @election.event.name %></h1>
<% unless @election.open? %>
  <p>This election is currently closed.  Voting times are between:<br />
  <%= @election.start_time %> and <%= @election.end_time %>
</p>
<% else %>
<%= render :partial=>"#{@election.class.to_s.downcase}_explanation" %>
<% if session[:username] %>
  <%= form_tag :action=>'vote' %>
    <%= hidden_field_tag "election_id", @election.id %>
    <%= submit_tag "Cast your ballot"%>
<% end %>
<% end %>
<dl>
<% @items.each do | item | %>

    <%= render :partial=>"#{item.class.to_s.downcase}_item", :locals=>{:item=>item} %>
<% end %>
</dl>
<% if @election.open? and session[:username] %>
  <%= submit_tag "Cast your ballot"%>
  <%= end_form_tag %>

<% end %>
